from numpy import array, float32


class Param:
    # members: name, typename, value, bounds, key
    
    def __init__(self, name, typename, value, bounds=None, key=None, resolution=20):
        self.name = name
        self.typename = typename
        self.value = value
        self.bounds = bounds
        self.key = key
        self.resolution = resolution
    
    def increment(self):
        self.value += (self.bounds[1] - self.bounds[0]) / self.resolution
        self.value = min(self.value, self.bounds[1])
        print self.name, '=', self.value

    def decrement(self):
        self.value -= (self.bounds[1] - self.bounds[0]) / self.resolution
        self.value = max(self.value, self.bounds[0])
        print self.name, '=', self.value


